/*
 * Cette servlet se charge de la gestion des erreurs
 * @author: Essoussi Mohamed Habib
 */
package com.aai.servlets;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class Erreur extends HttpServlet {

	
	private static final long serialVersionUID = -1889967268592679472L;

	public void service(HttpServletRequest req, HttpServletResponse rep) throws ServletException, IOException {
		HttpSession session;
		session = req.getSession(true);
		if (session.isNew()){
			req.getRequestDispatcher("/accueil").forward(req, rep);
		}
		else
		    afficheErreur(req, rep);
	}

	public void afficheErreur(HttpServletRequest req, HttpServletResponse rep)
		throws ServletException, IOException {
		      
		req.getRequestDispatcher("/erreur.jsp").forward(req, rep);
		  
	}
}

 
